package com.wangcang.widgetlibrary.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import com.wangcang.widgetlibrary.R;
import com.wangcang.widgetlibrary.notification.NotificationTools;

/**
 *  通知Notification
 * Created by ShineF on 2017/6/19 0019.
 */

public class NotificationActivity extends AppCompatActivity implements View.OnClickListener {

    private Button mShowCustom;
    private Button mShowNotification;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_notification);
        init();
    }

    public void init(){
        mShowCustom = (Button) findViewById(R.id.btn_show_custom);
        mShowNotification = (Button) findViewById(R.id.btn_show);
        mShowCustom.setOnClickListener(this);
        mShowNotification.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        int i = v.getId();
        if (i == R.id.btn_show_custom) {
            NotificationTools.getInstance(this).sendCustomNotification("这是一条自定义通知", "消息页面", IntentActivity.class );
        } else if (i == R.id.btn_show) {
            NotificationTools.getInstance(this).sendNotification("这是一条系统默认通知", "这是一条系统默认通知", "消息页面", IntentActivity.class);
        }
    }
}
